import * as types from '../constant/action-types'

const initInfo = {
  users: [],
  addedUsers: [],
  program: {}
}

export default (state = initInfo, action) => {
  switch (action.type) {
    case types.SEARCH_USER:
      return Object.assign({}, state, {users: action.users})
    case types.ADDED_USER:
      return Object.assign({}, state, {addedUsers: action.users})
    case types.SEARCH_PROGRAMS:
      return Object.assign({}, state, {program: action.program})
    default:
      return state
  }
}
